package com.feifan.common.utils.baiduai;

import java.util.HashMap;

/**
 * 组
 * @author: Alex
 * @create: 2020-09-21 00:49
 **/
public class GroupUtils {

    /**
     * 查询用户组
     * @return
     */
    public static String getGroupList() {
        HashMap<String, String> options = new HashMap<String, String>();
        options.put("start", "0");
        options.put("length", "1000");

        // 查询用户组
        return BaiDuAiResult.errorMessage(FaceClientUtil.getClient().getGroupList(options).toString());
    }

    /**
     * 创建用户组
     * @param groupId 用户组id
     * @return
     */
    public static String addGroup(String groupId) {
        HashMap<String, String> options = new HashMap<String, String>();

        // 创建用户组
        return BaiDuAiResult.errorMessage(FaceClientUtil.getClient().groupAdd(groupId, options).toString());
    }

    /**
     * 删除用户组
     * @param groupId 用户组id
     * @return
     */
    public static String groupDelete(String groupId) {
        HashMap<String, String> options = new HashMap<String, String>();

        // 创建用户组
        return BaiDuAiResult.errorMessage(FaceClientUtil.getClient().groupDelete(groupId, options).toString());
    }

}
